<?php


namespace App\Services;

/**
 * 其他回调
 * Class OtherCallbacksService
 * @package App\Services
 */
class OtherCallbacksService
{

    const ACTION_SHOP_CREATE = '/Admin/Callback/createSupplier';//创建供应商地址
    const ACTION_SHOP_AUDIT = '/Admin/Callback/auditSupplier';//审核供应商地址
    const ACTION_ORDER_CREATE = '/Admin/Callback/createOrder';//分销订单创建地址
    const ACTION_ORDER_LEASE_RENTAL = '/Admin/Callback/payRentalLease';//租期支付回调
    const ACTION_ORDER_REFUND = '/Admin/Callback/orderRefund';//退款订单回调


    const STATUS_PENDING = '1'; //'待审核'
    const STATUS_APPROVED = '2'; //'审核通过'
    const STATUS_REJECTED = '3'; //'审核拒绝'

    /**
     * 添加log
     * @param $message
     * @param array $request
     * @param array $response
     */
    public static function addLog($message,$request=[],$response=[]){
        $content = [
            'request'=>is_object($request) ? object_array($request) : $request,
            'response'=>is_object($response) ? object_array($response) : $response,
        ];
        \Illuminate\Support\Facades\Log::debug($message,$content);
    }
    /**
     * 获取加密规则
     * @param $param
     * @return string
     */
    public static function getAdminCrypt($param){
        return md5(json_encode($param, JSON_UNESCAPED_UNICODE + JSON_UNESCAPED_SLASHES) . CommonService::API_SECRET_KEY);
    }

    /**
     * 创建供应商回调
     * @param $member_id
     * @param $admin_id
     */
    public static function shopCreateNotify($member_id,$admin_id){

    }

    /**
     * 供应商审核通过回调
     * @param $member_id
     * @param $admin_id
     */
    public static function shopAuditPassNotify($member_id,$admin_id){

    }

    /**
     * 创建订单
     * @param $order_id
     * @param string $relation_id
     */
    public static function createOrderNotify($order_id,$relation_id){

    }

    /**
     * 租期支付回调
     * @param $order_id
     * @param string $relation_id
     */
    public static function payRentalLeaseNotify($order_id,$lease_id){

    }

    /**
     * 退款订单回调
     * @param $order_id
     * @param $refund_time
     */
    public static function orderRefundNotify($order_id,$refund_time){

    }

}
